package com.dfy.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.List;

@Data
public class SpotRequest {
    private Long id;

    @NotBlank(message = "景点名称不能为空")
    private String name;

    private String description;

    @NotBlank(message = "位置不能为空")
    private String location;

    @NotNull(message = "价格不能为空")
    @DecimalMin(value = "0.0", message = "价格不能小于0")
    private BigDecimal price;

    @DecimalMin(value = "0.0", message = "评分不能小于0")
    @DecimalMax(value = "5.0", message = "评分不能大于5")
    private BigDecimal rating;

    @NotBlank(message = "类型不能为空")
    private String type;

    @JsonProperty("category_type")
    @NotBlank(message = "分类类型不能为空")
    private String categoryType;

    @JsonProperty("image_urls")
    private List<String> imageUrls;

    private List<String> tags;

    @JsonProperty("opening_hours")
    private String openingHours;

    @JsonProperty("contact_phone")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确")
    private String contactPhone;

    @JsonProperty("position_left")
    @Pattern(regexp = "^\\d+(\\.\\d+)?%$", message = "左侧位置格式不正确，应为百分比形式")
    private String positionLeft;

    @JsonProperty("position_top")
    @Pattern(regexp = "^\\d+(\\.\\d+)?%$", message = "顶部位置格式不正确，应为百分比形式")
    private String positionTop;

    @JsonProperty("facilities")
    private List<SpotFacilityRequest> facilities;

    @JsonProperty("spotDetail")
    private SpotDetailRequest spotDetail;

    private String status;
} 